<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Data Admin Presentation</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link type="text/css" rel="stylesheet" href="css/main.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="css/chosen/chosen.css" />
		<link rel="stylesheet" href="css/bs.css" />
		<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
		<link rel="stylesheet" href="css/jquery.fileupload-ui.css">
		<!-- Templates Here -->

									
		<link type="text/css" rel="stylesheet" href="css/page.css" />
		<link type="text/css" rel="stylesheet" href="css/datepicker.css" >
        <link rel="stylesheet" type="text/css" media="screen"
			href="js/lib/poshytip/tip-darkgray/tip-darkgray.css" />
		<link rel="stylesheet" type="text/css" href="css/select2/select2.css">
		<style>
		td > input[type="text"]{
			width:80px;
		}
		
		textarea{
			width:100px;
		}
		
		.alpha{
			margin-top:3px;
		}
		</style>
		<!--[if IE 7]> 
		<style>
		.alpha{
			margin-top:8px;
		}
		</style>
		<![endif]-->		
		<script type="text/template" id="block_template">
				<div class="panel-container">
					<div class="panel-header">
						<div class="panel-title"><%= title %></div>
						<div class="panel-subtitle"></div>
						<div class="panel-tab">
							<div>
								<ul class="nav nav-pills">
									<li class="active" entry="1">
										<a href="javascript:void(0)" class="dropdown-toggle">
											<i class="icon-home"></i>
											<span><%= entry%></span>
										</a>							 
									</li>
								</ul>
							</div>
							<span class="triangle"></span>	
						</div>
						<div class="panel-line"> </div>
						<div class="close"></div>
					</div>
					<div class="panel-body"></div>
				</div>
		</script>
		<script type="text/template" id="tabmenu_template">
			 	<a href="javascript:void(0)" class="dropdown-toggle"><i class="icon-lock" c1="icon-lock" c0="icon-edit"></i><span></span><b class="caret"></b><button class="close icon-white">&times;</button></a>
				<ul class="dropdown-menu">
				   <li class='type'></li>
				   <li class='divider l0'></li>
				   <li class='l0'><div class="switch" data-left="ReadOnly" data-right="Edit" clicking="toggleEdit"></div></li>
				   <li class='divider l0 l1'></li>
				   <li class='l0 l1'><button class="btn btn-success btn-small">Save</button></li>
				   <li class='divider l0 l1'></li>
				   <li class='l0 l1'><button class="btn btn-danger btn-small">Purge</button></li>
				   <li class='divider l0 l1'></li>
				   <li class='l0 l1'><button class="btn btn-info btn-small">Duplicate</button></li>
				</ul>								 
				 			
		</script>
		<script type="text/template" id="toggle_template">
			<div class="switch-wrapper">
				<div class="opt left" style="width:100%">
				<div><%= left %></div><span class="helper"><%= left %></span>
				</div>
			<div class="opt right" style="width:0%">
				<div><%= right %></div><span class="helper"><%= right %></span></div>
			<div class="bar"></div>
			</div>
		</script>	
	
		<script type="text/template" id="combo_template">
			<select data-placeholder="<%= hint%>" class="combo-box">
				<option value=""></option>
			</select>
		</script>	
		<script type="text/template" id="tipItem_template">
			<li class="divider"></li>
			<li class="menu-item"> 
				<div class="item-wrapper">
					<span class='tip-val'> 
					<%= v[0]%>
					</span>
					<span class='type-wrapper'>
						<%= v[1]%>
					</span>
				</div>
			</li>				
		</script>
	
		<script type="text/template" id="typesel_template">
			<div class="type-selector">
			    <span class="ltri"></span>
			    <span class="typesel-body">
				    <i class="icon-tags icon-white"></i>
				    <ul>
				      <li>
				          	<span><h4><%= val[0]%></h4><b></b></span>
					        <ul>
							<%for(var i = 1; i<val.length; i++){%>
								<% if(val[i]==val[0]){%>
									<li class="selected">
								<%}else{%>			        	
					        		<li>
					        	<%}%>
					        	<h4><%= val[i]%> </h4></li>
					        <%}%>
		
					        </ul>
	
				      </li>
				    </ul>
				    <button class="close icon-white">&times;</button>
			    </span>
			</div>
		</script>	

		<script type="text/template" id="search_template">
			<div style="padding: 0 10px;">
				<div class="search-box ">
					<div class="switch" data-left="View" data-right="Add" step="toggleControl" clicking="setOverflow" clicked="rmOverflow"></div>
					<div class="input-prepend">
	                  <span class="add-on"><i class="icon-search"></i></span><div class='input-wrapper'><input type="text" placeholder="Type an identifier..."/></div>
	                <div class='sticky'></div>
	                </div>
					
					<div class="add-option">
						<div class="opt-view-port">
							<div class="switch" data-left="Quote" data-right="Issue" step="toggleInput" clicking="setShow" clicked="setHide"></div>
							<div class="combo" change="updateCategory"></div>
							<div class="combo"></div>
						</div>
					</div>
					<button class="btn go">Go!</button>
				</div>
			</div>
		</script>
<!-- <%for(var i = in fields){%> -->
		<script type="text/template" id="line_template">
			<div class="line-editor">
				<%for(var i = 0; i< fields.length; i++){%>
					<%var f=fields[i];%>	
					<div>
						<div class="input-prepend">
							<span class="add-on"><%= f[0]%></span><input class="span2" size="16" type="text" col="<%= f[1]%>" colid="<%= f[2]-0+1 %>" 
							<% if(f[3]){ %> placeholder="<%= f[3].join("/")%>"  sug=0 <%}%> />
						</div>
					</div>
				<%}%>
			</div>	
		</script>						
		<script type="text/template" id="table_template">
			<table class="table-hover table table-bordered table-striped"> 
				<thead> 
				<tr> 
					<%for(var i = 0; i<headers.length; i++){%>	
						<%var h=headers[i];%>
						<th i='<%= i%>' 
						<%if(h[1]){%>
							style="<%= h[1].css%>"
						<%}%>
						><%= h[0]%></th>
					<%}%>
				</tr>
				</thead>
				<tbody>
					<tr><td colspan="<%= headers.length%>"><center>No Data Found!</center></td></tr> 
				</tbody>
			</table> 	
		</script>
		<script type="text/template" id="rows_template">
			<%for(var i = 0; i<data.length; i++){%>	
				<%var row=data[i];%>
				<tr ndaid="<%= row[0]%>">
					<%for(var j=1;j<row.length;j++){%>	
						<%var c=row[j];%>
						<td><%= c%></td>
					<%}%>		
				</tr>
			<%}%>
		</script>	
		<script type="text/template" id="alert_template">
			<div class="alert fade in">
	            <button type="button" class="close" data-dismiss="alert">&times;</button>
	            <span><%= msg%></span>
	          </div>
		</script>	
		<script type="text/template" id="table_search_template">
			<div class="search-line">
				<div class="switch" data-left="View" data-right="Add" clicked="go"></div>		
				<div class="inputs"></div>
			</div>
			<div class="result-table"></div>
		</script>		
		<script type="text/template" id="bulk_entry_template">
			<div id="bulk_init" class="item-wrapper">
                <!-- The fileinput-button span is used to style the file input field as button -->
                <button type="button" id="btnbulkload" class="btn btn-primary load">
                    <i class="icon-upload icon-white"></i>
                    <span>Upload Files</span>
                </button>                
            </div>
		</script>
	</head>

	<body>
		<div id="main_body">
			<div id="header" class="header">
				<div class="index-logo"></div>
				<div class="title">Data Admin Presentation</div>
				<div class="signin-bar">
					<div class="signin_div">
						<button class="btn btn-primary signin" type="button">
							<b>Log In</b>
						</button>
					</div>
					<div class="pop-over clearfix fancy-scrollbar">
						<div class="header clearfix">
							<span class="header-title">Log In</span>
							<a class="close-btn js-close-popover" href="#">
								<span class="app-icon small-icon close-icon dark-hover"></span>
							</a>
						</div>
						<div class="content clearfix" style="">
							<div class="login-popover">
								<p>
									<label for="username">Username</label>
									<input id="username"
									name="username" title="username" type="text"
									placeholder="Username" />
								</p>
								<p>
									<label for="password">Password</label>
									<input id="password"
									name="password" title="password" type="password"
									placeholder="Password" />
								</p>
<!-- 								<p>
									<label for="env">Environment</label>
									<select>
										<option value="Blue">Blue</option>
									</select>
								</p> -->
								<p class="alert-box">
									
								</p>
								<p class="remember">
									<input id="signin_submit" value="Log In" type="button" class="btn btn-success" />
									<input id="remember" name="remember_me" value="1" type="checkbox" />
									<b style="margin-left:2px;">Remember me</b>
								</p>
								<p class="forgot">
									<a href="javascript:void(0);" id="resend_password_link">Forgot your password?</a>
								</p>
							</div>
						</div>
					</div>
				</div>
				<div class="welcome-bar" style="display:none;">
					<div class="signin_div">
						<span>Welcome, XXX</span>
						<button class="btn btn-success" id="logout_button" type="button">
							<b>Logout</b>
						</button>
					</div>
				</div>			
			</div>

			<div class="body">
				<!-- main content here -->

			</div>							
		</div>
		
		<script type="text/javascript" src="js/lib/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="js/lib/underscore-min.js"></script>
		<script type="text/javascript" src="js/lib/backbone-min.js"></script>
		<script type="text/javascript" src="js/lib/zoomgrid/ZoomGrid.js"></script>		
		<script type="text/javascript" src="js/lib/chosen.jquery.js"></script>	
		<script type="text/javascript" src="js/lib/jquery.pagination.js"></script>	

		<script type="text/javascript" src="js/lib/bootstrap-alert.js"></script>

		<script type="text/javascript" src="js/lib/colResizable-1.3.min.js"></script>	
		
		<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
		<script type="text/javascript" src="js/lib/vendor/jquery.ui.widget.js"></script>						
		<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
		<script type="text/javascript" src="js/lib/jquery.iframe-transport.js"></script>
		<!-- The basic File Upload plugin -->
		<script type="text/javascript" src="js/lib/jquery.fileupload.js"></script>
		<script type="text/javascript" src="js/page_bulkload.js"></script>
		
		<script src="js/lib/bootstrap-datepicker.js" type="text/javascript"></script>
		<script src="js/lib/mustache.js" type="text/javascript"></script>
		<script src="js/lib/select2.js" type="text/javascript"></script>
		<script src="js/lib/poshytip/jquery.poshytip.js" type="text/javascript"></script>				
		
				
		<script type="text/javascript" src="js/utils.js"></script>		
		<script type="text/javascript" src="js/models.js"></script>

		<script type="text/javascript" src="js/views/Button.js"></script>		
		<script type="text/javascript" src="js/views/TipsMenu.js"></script>		
		<script type="text/javascript" src="js/views/TabMenu.js"></script>		
		<script type="text/javascript" src="js/views/AssetView.js"></script>		
		<script type="text/javascript" src="js/views/Block.js"></script>
		<script type="text/javascript" src="js/views/Layout.js"></script>
		<script type="text/javascript" src="js/views/Table.js"></script>
		<script type="text/javascript" src="js/views/InputList.js"></script>
		<script type="text/javascript" src="js/views/RU.js"></script>
		<script type="text/javascript" src="js/views/BulkView.js"></script>
		

		
		
		<!-- views -->
		<script src="js/backbone-page.js" type="text/javascript"></script>
		<script src="js/backbone-form.js" type="text/javascript"></script>
		<script src="js/backbone-form-jui-ext.js" type="text/javascript"></script>
		<script src="js/backbone-table.js" type="text/javascript"></script>
		
		<!-- templates -->
		<script src="js/templates/page-bootstrap.js" type="text/javascript"></script>
		<script src="js/templates/form-bootstrap.js" type="text/javascript"></script>
		<script src="js/templates/table-bootstrap.js" type="text/javascript"></script>
		
		<script src="js/page_cne.js" type="text/javascript"></script>
		
		<script type="text/javascript" src="js/jsonp.js"></script>
		<script type="text/javascript" src="js/popup.js"></script>		
		<script type="text/javascript" src="js/app.js"></script>		
		<script type="text/javascript">

			$(function(){
				var size={
					w:$(window).width(),
					h:$(window).height()
				}
				
				body = new Layout({collection: ViewData.layout});
				$.each(view_model, function(k, v) {
					body.addSubViewAction(k, v);
				});
				// for(var v in view_model){
					// body.addSubView(v, view_model[v]);
				// }	
				if(size.h -60 > 360){
					$(".body > .screen").height(size.h -60);
					body.currentGrid.restore(true);
				}
				$(window).resize(function() {
					// if(size.h -60 > 260)
					var g = body.currentGrid;
					if(g.active)
						g.zoom(g.active);
					else
				  		g.restore(true);
				});				
				var ck = util.readCookie("login");
				if(ck!==null){
					ViewData.Login = JSON.parse(ck);
					if(ViewData.Login.usr)
						for(var i in Auth.ctrl){
							Auth.ctrl[i].trigger('user');
						}
				}
			});
		</script>

	</body>
</html>